<?php

include '../Classes/studentHandler.php';
include'../Classes/db.php';

$y=new DbConnect();
$conn=$y->getConnection();

$ini=addslashes($_GET['ini']);
$first=addslashes($_GET['first']);
$last=addslashes($_GET['last']);
$gen=$_GET['gender'];
$bdt1=$_GET['bdt'];
$nic=$_GET['nic'];
$add=addslashes($_GET['address']);
$cont=$_GET['contact'];
$email=$_GET['email'];

$month=substr($bdt1,3,2);
$year=substr($bdt1,6,4);
$day=substr($bdt1,0,2);
$bdt=$year."-".$month."-".$day;

$time_now=mktime(date('H')+5,date('i')+30,date('s'),date('m'),date('d'),date('Y'));
$j_dt=date('Y-m-d',$time_now);

 $year=date('Y',$time_now); 
 $month=date('m',$time_now); 
 $date=date('d',$time_now);
 
$st=new StudentHandler();
 
$st->setIni($ini);
$st->setFname($first);
$st->setLname($last);
$st->setGender($gen);
$st->setBday($bdt);
$st->setNic($nic);
$st->setAddress($add);
$st->setContact($cont);
$st->setEmail($email);
$st->setJday($j_dt);
$st->setConnect($conn);

$result=$st->studentAdd();
echo $result;

?>